package nowcoder;
/**
 * 小易的升级之路
 */
import java.util.*;
public class Day22_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        while(input.hasNextInt()){
            int n = input.nextInt();
            int cur = input.nextInt();
            int[] s = new int[n];
            for (int i = 0; i < s.length; i++) {
                s[i] = input.nextInt();
                if(s[i] <= cur){
                    cur += s[i];
                }else{
                    cur += maxGongYueNum(cur, s[i]);
                }
            }
            list.add(cur);
        }

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }

    private static int maxGongYueNum(int a, int b) {
        // 14 21
        int min = Math.min(a, b);
        for (int i = min; i > 1; i--) {
            if(a % i == 0 && b % i == 0){
                return i;
            }
        }
        return 1;
    }
}
